package com.tdf.lolpanel.constant;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class JwtConstant {
    // 加密密码
    public static String secretKey;
    // 过期时间
    public static Long ttl;
    // 设置前端传递过来的令牌名称
    public static String tokenName;

    @Autowired
    private JwtConstant(
            @Value("${jwt.secret-key}") String secretKey,
            @Value("${jwt.ttl}") Long ttl,
            @Value("${jwt.token-name}") String tokenName
    ) {
        this.secretKey = secretKey;
        this.ttl = ttl;
        this.tokenName = tokenName;
    }

    public static final String UID = "uid";
    public static final String UNAME = "username";
    public static final String STATUS = "sta";
}
